package org.huolala.controller;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.huolala.dao.CarTypeDao;
import org.huolala.pojo.CarType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/cartype")
public class CarTypeController {
	@Resource
	private CarTypeDao carTypeDao;

	public void setCarTypeDao(CarTypeDao carTypeDao) {
		this.carTypeDao = carTypeDao;
	}
	
	@RequestMapping(value="/all",produces="application/json")
	@ResponseBody
	public List<CarType> all() throws Exception {
		List<CarType> list = carTypeDao.getAll();
		return list;
	}
	
}
